package com.xnfh.framework.bean

import android.os.Parcel
import android.os.Parcelable
import com.xnfh.framework.utils.NoArg
import java.io.Serializable

/**
 * @Description:返回体实体类
 * @author ziheng
 * @date 2022/12/19 13:46
 */
@NoArg
data class HomeData(
    val endRow: Int,
    val firstPage: Int,
    val hasNextPage: Boolean,
    val hasPreviousPage: Boolean,
    val isFirstPage: Boolean,
    val isLastPage: Boolean,
    val lastPage: Int,
    val list: List<VideoBean>,
    val navigateFirstPage: Int,
    val navigateLastPage: Int,
    val navigatePages: Int,
    val navigatepageNums: List<Int>,
    val nextPage: Int,
    val pageNum: Int,
    val pageSize: Int,
    val pages: Int,
    val prePage: Int,
    val size: Int,
    val startRow: Int,
    val total: Int
): Serializable

data class SslToken(
    val accessKeyId: String,
    val accessKeySecret: String,
    val expiration: String,
    val securityToken: String,
)

data class AnthologiesBean(
    var collected: Boolean,
    val title: String,
    val summary: String,
    val videos: List<VideoBean>
)

@NoArg
data class VideoBean(
    val chargeType: Boolean,
    val copyrightId: String,
    val createTime: String,
    val currentSet: Int = 0,
    val dramaId: String,
    val gender: Int,
    val id: String,
    val mvUrl: String,
    val original: Int,
    val roundCover: String,
    val shelfTime: String,
    val squareCover: String,
    val status: Boolean,
    val summary: String,
    val title: String,
    val type: Int,
    val updateTime: String,
    val videoClarity: String,
    val videoFormat: String,
    val singAlongUrl: String,
    var collected: Boolean,
    var collectionId: String,
    //自定义字段，是否是推荐列表
    var isListVideo: Boolean = false,
    //自定义字段，收藏是否编辑选中
    var isCollectEditSelect: Boolean = false
): Serializable


data class OpenVipBean(
    val createTime: String,
    val discount: Double,
    val freeMonth: Int,
    val id: String,
    val level: Int,
    val orders: Int,
    val originalPrice: Double,
    val remark: String,
    val showPrice: Int,
    val slogan: String,
    val status: Boolean,
    val updateTime: String,
    //自定义选中类型
    var openVipIsChecked: Boolean
)


data class LoginStateBean(
    val status: Int,
    val token: String,
    val user: User
): Serializable

data class User(
    val age: Int,
    val avatar: String,
    val babyAgeGroup: String,
    val babyGender: Int,
    val city: String,
    val createTime: String,
    val email: String,
    val gender: Int,
    val id: Int,
    val loginDate: String,
    val loginIp: String,
    val nickname: String,
    val pageNum: Int,
    val pageSize: Int,
    val phone: String,
    val selectEnd: String,
    val selectStart: String,
    val source: Int,
    val status: Boolean,
    val updateTime: String,
    val username: String
)



data class UserInfo(
    val age: Int,
    val avatar: String,
    val babyAgeGroup: String,
    val babyGender: Int,
    val city: String,
    val createTime: String,
    val email: String,
    val gender: Int,
    val id: Int,
    val loginDate: String,
    val loginIp: String,
    val memberEndTime: String,
    var memberStatus: Boolean,
    val nickname: String,
    val phone: String,
    val source: Int,
    val status: Boolean,
    val updateTime: String,
    val username: String
): Parcelable {
    constructor(parcel: Parcel) : this(
        parcel.readInt(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readInt(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readInt(),
        parcel.readInt(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readByte() != 0.toByte(),
        parcel.readString().toString(),
        parcel.readString().toString(),
        parcel.readInt(),
        parcel.readByte() != 0.toByte(),
        parcel.readString().toString(),
        parcel.readString().toString()
    ) {
    }

    override fun writeToParcel(parcel: Parcel, flags: Int) {
        parcel.writeInt(age)
        parcel.writeString(avatar)
        parcel.writeString(babyAgeGroup)
        parcel.writeInt(babyGender)
        parcel.writeString(city)
        parcel.writeString(createTime)
        parcel.writeString(email)
        parcel.writeInt(gender)
        parcel.writeInt(id)
        parcel.writeString(loginDate)
        parcel.writeString(loginIp)
        parcel.writeString(memberEndTime)
        parcel.writeByte(if (memberStatus) 1 else 0)
        parcel.writeString(nickname)
        parcel.writeString(phone)
        parcel.writeInt(source)
        parcel.writeByte(if (status) 1 else 0)
        parcel.writeString(updateTime)
        parcel.writeString(username)
    }

    override fun describeContents(): Int {
        return 0
    }

    companion object CREATOR : Parcelable.Creator<UserInfo> {
        override fun createFromParcel(parcel: Parcel): UserInfo {
            return UserInfo(parcel)
        }

        override fun newArray(size: Int): Array<UserInfo?> {
            return arrayOfNulls(size)
        }
    }
}

data class WxOrderBean(
    val memberEndTime: String,
    val orderId: Long,
    val payUrl: String
)

data class WxPayStateBean(
    val completeTime: String,
    val createTime: String,
    val id: Long,
    val money: Double,
    val otherTradeNo: String,
    val payWay: Int,
    val resourceId: String,
    val state: Int,
    val type: Int,
    val updateTime: String?,
    val userId: Int
)


data class OrdersBean(
    val endRow: Int,
    val firstPage: Int,
    val hasNextPage: Boolean,
    val hasPreviousPage: Boolean,
    val isFirstPage: Boolean,
    val isLastPage: Boolean,
    val lastPage: Int,
    val list: List<ItemOrder>,
    val navigateFirstPage: Int,
    val navigateLastPage: Int,
    val navigatePages: Int,
    val navigatepageNums: List<Any>,
    val nextPage: Int,
    val pageNum: Int,
    val pageSize: Int,
    val pages: Int,
    val prePage: Int,
    val size: Int,
    val startRow: Int,
    val total: Int
)

data class ItemOrder(
    val completeTime: String,
    val createTime: String,
    val discount: Double,
    val freeMonth: Int,
    val id: Long,
    val level: Int,
    val money: Double,
    val orders: Int,
    val originalPrice: Int,
    val otherTradeNo: String,
    val payWay: Int,
    val remark: String,
    val resourceId: String,
    val showCompleteTime: String,
    val showPrice: Double,
    val slogan: String,
    val state: Int,
    val status: Boolean,
    val type: Int,
    val updateTime: String,
    val userId: Int
)
